{% extends 'window.twig' %}
{% block body %}
    <div class="admin-main-container">

        <div class="clearfix btn-control" style="padding: 10px 0 0">
            <form action="notification.list" method="get" id="frmSearch">
                <div class="form-inline">
                    <table style="width: 100%;  margin: 0 15px;">
                        <tr>
                            <td style="width: 225px;">
                                <div class="input-group">
                                    <div class="input-group-addon">状态&nbsp;&nbsp;&nbsp;</div>
                                    <select class="form-control" name='state' style="width: 120px;">
                                        <option value="-1">所有</option>
                                        <option value="4"{% if n_state == 4 %} selected="selected" {% endif %}>待处理</option>
                                        <option value="2"{% if n_state == 2 %} selected="selected" {% endif %}>已处理</option>
                                        <option value="1"{% if n_state == 1 %} selected="selected" {% endif %}>未提醒</option>
                                    </select>
                                </div>
                            </td>
                            <td style="width: 360px;">
                                <div class="input-group">
                                    <div class="input-group-addon">关键字搜索</div>
                                    <input type="text" name="wd" class="search-input form-control" value="{{ wd }}"
                                           placeholder="任务关键字" style="width: 250px;">
                                </div>
                            </td>
                            <td>
                                <button class="btn btn-default" type="submit" id="search"><i
                                            class="glyphicon glyphicon-search"></i> 搜  索</button>

                            </td>
                        </tr>
                    </table>
                </div>

            </form>
        </div>

        <div class="tools auth-botton with-padding btn-control data-view">
            <span class="action-btn">
                <a id="add-group" class="btn btn-default {{ UserPermission('NotificationAdd') }}"
                   href="notification.view.add">新 增</a>
                <a id="add-group" class="btn btn-default ajax-post confirm"
                   href="notification.read" target-form="ids">完成它</a>
                <a url="notification.delete" class="btn btn-default ajax-post confirm
                {{ UserPermission('DelNotification') }}" target-form="ids">删 除</a>
            </span>

        </div>
        <!-- 数据列表 -->
        <div class="data-table with-padding data-view">
            <table class="table table-bordered table-striped ">
                <thead>
                <tr>
                    <th class="row-selected row-selected">
                        <input class="check-all" type="checkbox" data-target=".ids"></th>
                    <th style="width: 350px;">内容</th>
                    <th class="">提醒时间</th>
                    <th class="">状态</th>
                    <th class="hidden">标题</th>
                    <th class="">操作</th>
                </tr>
                </thead>
                <tbody>
                    {% for n in noticeList %}
                    <tr>
                        <td><input class="ids" type="checkbox"{% if n.notice_state == 2 %} disabled="disabled" {% endif %}  name="nid[]" value="{{ n.nid }}"></td>
                        <td><span>{{ n.notice_message|raw }}&nbsp;&nbsp;&nbsp;
                                <a href="#" onclick="return parent.osw.noticeOpenTask('{{ n.task_no }}');">☞点击查看详情☜</a></span></td>
                        <td>{{ n.notice_time|date("Y-m-d H:i") }}</td>
                        <td>{{ NoticeState(n.notice_state) }}</td>
                        <td class="hidden">{{ n.notice_title }}</td>
                        <td>
                            <a href="notification.delete" post-data='nid={{ n.nid }}' class="confirm ajax-post" target-form="no_data">删除</a>
                            {% if n.notice_state == 1 or n.notice_state == 4 %}
                            <a href="notification.read" post-data='nid[]={{ n.nid }}' class="confirm ajax-get">完成它</a>
                            {% endif %}
                            <!--修改内容结束-->
                        </td>
                    </tr>
                        {% endfor %}
                </tbody>
            </table>

            <div style="height: 50px;"></div>
        </div>
        <div class="page">
            {% include 'block/page.twig' %}
        </div>
    </div>
{% endblock %}
{% block script %}
    <script type="text/javascript">
        var osw = {noticeOpenTask:function(s){parent.osw.noticeOpenTask(s);}}
    </script>
{% endblock %}